<%--
  Created by IntelliJ IDEA.
  User: hp
  Date: 2021/3/28
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div id="bookrack" style="margin: 100px auto">
    <table style="width: 500px" border="1" cellpadding="5" cellspacing="0">
        <thead>
        <tr>un
            <th>nid</th>
            <th>nname</th>
            <th>chapterId</th>
            <th>hisTime</th>
        </tr>
        </thead>
        <tbody>
        <tr v-for="bookRact in bookRacts">
            <td>{{bookRact.nid}}</td>
            <td>{{bookRact.nname}}</td>
            <td>{{bookRact.chapterId}}</td>
            <td>{{bookRact.hisTime}}</td>
        </tr>
        </tbody>
    </table>
</div>
<script src="/comms/jquery.js"></script>
<script src="/comms/vue.js"></script>
<script>
    let v = new Vue({
        el: "#bookrack",
        data: {
            bookRacts: [] //
        },
        created: function () {
            let this_ = this;
            // 访问服务器
            $.ajax({
                url: "/bookrack/showBookRacks",
                dataType: "json",
                success: function (data) {
                    // jQuery  已经帮助我们将 json 字符串 转成了 json 数组
                    // console.log(typeof data);
                    // console.log(data.__proto__.constructor);
                    this_.users = data;
                }
            })
        }
    })
</script>

</body>
</html>
